package com.artlongs.webapp.controller;

import com.artlongs.webapp.user.model.User;
import com.artlongs.webapp.user.service.UserService;
import com.artlongs.base.vo.BizRetVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Function: register
 *
 * @version $Revision$ $Date$
 *          Date: 16-1-8
 *          Time: 上午10:25
 * @author: monda
 * @since 3.0
 */
@Controller
@RequestMapping("/reg")
public class RegController {
    private final Logger log = LoggerFactory.getLogger(getClass());

    @Resource(name="userServiceImpl")
    private UserService userService;


    @RequestMapping("")
    public String index(Model model){

        return "/reg";
    }


    @RequestMapping("/save")
    @ResponseBody
    public BizRetVo save(User user) {
        return userService.register(user);
    }


}
